package cn.dengta.webapp.trade.model;

import java.util.HashMap;
import java.util.Map;

import cn.dengta.common.context.I18N;
import cn.dengta.common.model.ValueProxy;
import cn.dengta.common.model.ValueProxyImpl;
import cn.dengta.context.model.Language;
import cn.dengta.context.model.WesKit;
import lombok.Getter;

import static cn.dengta.context.model.ImEnumI18nKey.*;

@Getter
public enum IntimacyLevelAward implements ValueProxyImpl<IntimacyLevelAward, Integer> {
	A0(0, "无", "无"),
	A1(1, "聊天免费（条）", INTIMACY_LEVEL_L1),
	A2(2, "语音免费（分）", INTIMACY_LEVEL_L2),
	A3(3, "视频免费（分）", INTIMACY_LEVEL_L3),
	A4(4, "聊天视频语音优惠折扣（%）", INTIMACY_LEVEL_L4),
	A5(5, "礼物优惠折扣（%）", INTIMACY_LEVEL_L5),
	A6(6, "查看对方私人相册", INTIMACY_LEVEL_L6),
	;
	public final Integer value;
	/** 详细说明，多语言 */
	public final String desc;
	final ValueProxy<IntimacyLevelAward, Integer> proxy;

	public static Map<WesKit, Map<IntimacyLevelAward, String>> defIcon = new HashMap<>();

	static {
		Map<IntimacyLevelAward, String> map = new HashMap<>();
		map.put(A1, "https://oss.hholamet.com/internal/holamet/chat.png!dt");
		map.put(A6, "https://oss.hholamet.com/internal/holamet/pri_photo.png!dt");
		map.put(A3, "https://oss.hholamet.com/internal/holamet/call_video.png!dt");
		map.put(A4, "https://oss.hholamet.com/internal/holamet/sale_video.png!dt");
		map.put(A5, "https://oss.hholamet.com/internal/holamet/sale_gift.png!dt");
		defIcon.put(WesKit.main, map);
	}

	IntimacyLevelAward(Integer value, String label, String desc) {
		this.value = value;
		this.desc = desc;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	public String getDesc(Language language, Integer value) {
		return I18N.msg(desc, language.locale, value);
	}
}
